package com.shiroha.common.feign.client;

import com.shiroha.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "notification-service")
public interface NotificationClient {

    @PostMapping("/ns/email/post")
    Result<String> sendEmailCode(@RequestParam("email") String email);

    @GetMapping("/ns/email/check")
    Result<Boolean> checkCode(@RequestParam("email") String email, @RequestParam("code") String code);

    @PostMapping("/ns/notifications")
    Result<String> sendNotification(@RequestParam("type") int type, @RequestBody Map<String, Object> payload);
}
